Optimal. Leaf size=41 \[ \frac{\tanh ^{-1}(\sin (x))}{a}-\frac{\sqrt{b} \tanh ^{-1}\left (\frac{\sqrt{b} \sin (x)}{\sqrt{a+b}}\right )}{a \sqrt{a+b}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0524032, antiderivative size = 41, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.308, Rules used = {3186, 391, 206, 208} \[ \frac{\tanh ^{-1}(\sin (x))}{a}-\frac{\sqrt{b} \tanh ^{-1}\left (\frac{\sqrt{b} \sin (x)}{\sqrt{a+b}}\right )}{a \sqrt{a+b}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3186
Rule 391
Rule 206
Rule 208
Rubi steps
\begin{align*} \int \frac{\sec (x)}{a+b \cos ^2(x)} \, dx &=\operatorname{Subst}\left (\int \frac{1}{\left (1-x^2\right ) \left (a+b-b x^2\right )} \, dx,x,\sin (x)\right )\\ &=\frac{\operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\sin (x)\right )}{a}-\frac{b \operatorname{Subst}\left (\int \frac{1}{a+b-b x^2} \, dx,x,\sin (x)\right )}{a}\\ &=\frac{\tanh ^{-1}(\sin (x))}{a}-\frac{\sqrt{b} \tanh ^{-1}\left (\frac{\sqrt{b} \sin (x)}{\sqrt{a+b}}\right )}{a \sqrt{a+b}}\\ \end{align*}
Mathematica [A] time = 0.0556557, size = 38, normalized size = 0.93 \[ \frac{\tanh ^{-1}(\sin (x))-\frac{\sqrt{b} \tanh ^{-1}\left (\frac{\sqrt{b} \sin (x)}{\sqrt{a+b}}\right )}{\sqrt{a+b}}}{a} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.028, size = 47, normalized size = 1.2 \begin{align*}{\frac{\ln \left ( \sin \left ( x \right ) +1 \right ) }{2\,a}}-{\frac{b}{a}{\it Artanh} \left ({\sin \left ( x \right ) b{\frac{1}{\sqrt{ \left ( a+b \right ) b}}}} \right ){\frac{1}{\sqrt{ \left ( a+b \right ) b}}}}-{\frac{\ln \left ( \sin \left ( x \right ) -1 \right ) }{2\,a}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.87842, size = 329, normalized size = 8.02 \begin{align*} \left [\frac{\sqrt{\frac{b}{a + b}} \log \left (-\frac{b \cos \left (x\right )^{2} + 2 \,{\left (a + b\right )} \sqrt{\frac{b}{a + b}} \sin \left (x\right ) - a - 2 \, b}{b \cos \left (x\right )^{2} + a}\right ) + \log \left (\sin \left (x\right ) + 1\right ) - \log \left (-\sin \left (x\right ) + 1\right )}{2 \, a}, \frac{2 \, \sqrt{-\frac{b}{a + b}} \arctan \left (\sqrt{-\frac{b}{a + b}} \sin \left (x\right )\right ) + \log \left (\sin \left (x\right ) + 1\right ) - \log \left (-\sin \left (x\right ) + 1\right )}{2 \, a}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\sec{\left (x \right )}}{a + b \cos ^{2}{\left (x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.18786, size = 77, normalized size = 1.88 \begin{align*} \frac{b \arctan \left (\frac{b \sin \left (x\right )}{\sqrt{-a b - b^{2}}}\right )}{\sqrt{-a b - b^{2}} a} + \frac{\log \left (\sin \left (x\right ) + 1\right )}{2 \, a} - \frac{\log \left (-\sin \left (x\right ) + 1\right )}{2 \, a} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]